<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.jsp" %>

<script type="text/javascript">
	$(document).ready(function(){
		setWorkFlowURL('<c:out value="${flowExecutionUrl}" />');
	});
</script>

<div style="width: 100%;" align="center">
	<div id="vaultDetailsDiv" style="width: 60%;" align="center">
		<form:form commandName="documentCustodianDetailsForm" id="custodianDetails">
			<form:hidden path="vaultId" value="${documentCustodianDetailsForm.vaultId}" />
			<table class="adminFilterTable">
				<tr class="tableChildHeaderColor"> 
					<th colspan="9"> EDIT VAULT DETAILS </th> 
				</tr>
				<tr class="formSpacingRow"><td></td> </tr>
				<tr class="text ui-widget text-align-right">
					<td colspan="9" align="left">* (All fields are mandatory)</td>
				</tr>
				<tr class="formSpacingRow"><td></td> </tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td class="formLabel"><label>Vault Number</label></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formField"><form:input path="vaultNumber" id="vaultNumber" name="vaultNumber" /></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formLabel"><label>Vault Location</label></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formField"><form:input path="vaultLocation" id="vaultLocation" name="vaultLocation" /></td>
					<td class="spacingColumnWidthLess"></td>
				</tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td colspan="3" align="center"><form:errors path="vaultNumber" cssClass="text errorMsg"></form:errors></td>
					<td class="spacingColumnWidthLess"></td>
					<td colspan="3" align="center"><form:errors path="vaultLocation" cssClass="text errorMsg"></form:errors></td>
					<td class="spacingColumnWidthLess"></td>
				</tr>
				<tr class="formSpacingRow formBlockColor">
					<td></td>
				</tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td class="formLabel"><label>Custodian Name</label></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formField"><form:input path="custodianName" id="custodianName" name="custodianName" /></td>
				</tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td colspan="3" align="center"><form:errors
							path="custodianName" cssClass="text errorMsg"></form:errors></td>
				</tr>
				<tr class="formSpacingRow formBlockColor">
					<td></td>
				</tr>
				<tr class="formSpacingRow formBlockColor">
					<td></td>
				</tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td class="formLabel"><label>Custodian Id</label></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formField"><form:input path="custodianId" id="custodianId" name="custodianId" /></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formLabel"><label>Custodian Designation</label></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formField"><form:input path="custodianDesig" id="custodianDesig" /></td>
					<td class="spacingColumnWidthLess"></td>
				</tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td colspan="3" align="center"><form:errors path="custodianId" cssClass="text errorMsg"></form:errors></td>
					<td class="spacingColumnWidthLess"></td>
					<td colspan="3" align="center"><form:errors path="custodianDesig" cssClass="text errorMsg"></form:errors></td>
					<td class="spacingColumnWidthLess"></td>
				</tr>
				<tr class="formSpacingRow formBlockColor">
					<td></td>
				</tr>
				<tr class="formSpacingRow formBlockColor">
					<td></td>
				</tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td class="formLabel"><label>Custodian Business Unit</label></td>	<!-- changed from location to business unit on 25-02-2012 as told by shubh -->
					<td class="spacingColumnWidthLess"></td>
					<td class="formField">
						<form:select path="custodianLocId" cssClass="text ui-widget-content ui-corner-all" onchange="loadDepttForBU(this.id,'custodianDepttId')">
							<form:option value="0">Choose Business Unit</form:option>	<!-- changed from location to business unit on 25-02-2012 as told by shubh -->
							<c:forEach items="${BU_ID_NAME_MAP}" var="item">
								<form:option value="${item.key}">${item.value}</form:option>
							</c:forEach>
						</form:select></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formLabel"><label>Custodian Department</label></td>
					<td class="spacingColumnWidthLess"></td>
					<td class="formField"><form:select path="custodianDepttId" cssClass="text ui-widget-content ui-corner-all" id="custodianDepttId">
							<form:option value="0">Choose Department</form:option>
							<c:forEach items="${DEPTT_ID_NAME_MAP}" var="item">
								<form:option value="${item.key}">${item.value}</form:option>
							</c:forEach>
						</form:select></td>
				</tr>
				<tr class="formSpacingRow formBlockColor">
					<td></td>
				</tr>
				<tr class="formSpacingRow formBlockColor">
					<td></td>
				</tr>
				<tr>
					<td class="spacingColumnWidthLess"></td>
					<td align="left" valign="middle" colspan="7">
						<input type="hidden" value="${documentCustodianDetailsForm.docId}" name="docId" id="docId">
						<input type="button" class="formButton ui-corner-all" value="Update" onclick="updateVaultDetails('custodianDetails','submit')">&nbsp;
						<input type="button" value="Back" class="formButton ui-corner-all" onclick="javascript:goBack('back');"/> 
					</td>
					<td class="spacingColumnWidthLess"></td>
				</tr>
				<tr class="formSpacingRow formBlockColor"> <td></td> </tr>
			</table>
		</form:form>
	</div>
</div>